package com.bwie.auth.controller;

import com.bwie.auth.remote.UserRemote;
import com.bwie.auth.service.AuthUserService;
import com.bwie.common.domain.request.UserRequest;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @className: UserController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 张雨乐
 * @date: 2025/9/1 9:17
 */
@CrossOrigin
@RestController
public class UserController {
    @Autowired
    private AuthUserService authUserService;

    /**
     * 获取验证码
     * @param phone
     * @return
     */
    @GetMapping("getCode/{phone}")
    public Result getCode(@PathVariable String phone){
        return authUserService.getCode(phone);
    }
    /**
     * 登录
     * @param userRequest
     * @return
     */
    @PostMapping("login")
    public Result login(@RequestBody UserRequest userRequest){
        return authUserService.login(userRequest);
    }
    /**
     * 角色选择
     * @param roleId
     * @return
     */
    @GetMapping("role/{roleId}")
    public Result role(@PathVariable String roleId){
        return authUserService.role(roleId);
    }
    /**
     * 角色选择
     * @param
     * * @return
     */
    @GetMapping("menu")
    public Result menu(){
        return authUserService.menu();
    }


}
